package fr.vvins.core.catalog.entity;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;

/**
 * Sku entity
 */
@Entity
@Table(schema="vvins",name="VV_SKU")
@Inheritance(strategy=InheritanceType.JOINED)
public class Sku extends EntityImpl implements Serializable {

	private static final long serialVersionUID = 6923164640325755909L;
	
	@Id
	@GeneratedValue
	@Column(name="ID")
	private Integer id;
	
	@ManyToOne
	@JoinColumn(name="PRODUCT_ID")
	private Product parentProduct;
	
	@Basic
	@Column(name="NAME")
	private String name;
	
	@Basic
	@Column(name="DTYPE")
	private String type;
	
	@Basic
	@Column(name="PRICE")
	private Long price;
	
	@Basic
	@Column(name="STOCK")
	private String stock;

	public Sku() {
	}

	public Sku(int id, Product parentProduct) {
		this.id = id;
		this.parentProduct = parentProduct;
	}

	public Sku(int id, Product parentProduct, String name, String type) {
		this.id = id;
		this.parentProduct = parentProduct;
		this.name = name;
		this.type = type;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}
	
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Product getParentProduct() {
		return parentProduct;
	}

	public void setParentProduct(Product parentProduct) {
		this.parentProduct = parentProduct;
	}

	public Long getPrice() {
		return price;
	}

	public void setPrice(Long price) {
		this.price = price;
	}

	public String getStock() {
		return stock;
	}

	public void setStock(String stock) {
		this.stock = stock;
	}

}
